package com.hiwan.unions.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.hiwan.unions.R;
import com.hiwan.unions.application.AppManager;

/**
 * Created by llg on 2017/7/15.
 */
public class CallPhoneDialog extends Dialog {
    private Context context;
    private TextView dialogTitleTxt;
    private SumpayDialogListener listener;

    //    private TextView dialogTitleTxt;
    public CallPhoneDialog(Context context) {
        super(context, R.style.SumpayDialog);
        // TODO Auto-generated constructor stub
        this.context = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.call_phone_dialog);
        findViewById(R.id.previousBtn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        dialogTitleTxt = (TextView) findViewById(R.id.dialogTitleTxt);
        findViewById(R.id.nextBtn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                listener.nextBtn();
            }
        });
    }

    public void setOnTextLinstener(SumpayDialogListener listener) {
        this.listener = listener;
    }


    public interface SumpayDialogListener {
        abstract void nextBtn();

    }

    public void show(String phone) {
        show();
        dialogTitleTxt.setText(phone);
    }
}
